Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backupccl: add deprecation notice for BACKUP TO and RESTORE FROM without subdir #78165

Merged
merged 3 commits into from
Mar 22, 2022

Conversation

adityamaru
Copy link
Contributor

backupccl: add deprecation notice for BACKUP TO

Informs: #78153

Release note (sql change): The BACKUP TO syntax
to take backups is deprecated, and will be removed in a future
release. Users are recommended to create a backup collection
using the BACKUP INTO syntax in our docs.

backupccl: add deprecation notice to RESTORE FROM without subdir
Informs: #78153

Release note (sql change): The RESTORE FROM syntax without an
explicit subdirectory pointing to a backup in a collection is deprecated,
and will be removed in a future release.
Users are recommended to use RESTORE FROM <backup> IN <collection> to
restore a particular backup in a collection.

backupccl: add datadriven tests for deprecation notice
Informs: #78153

Release note: None

@adityamaru adityamaru requested review from dt, msbutler and a team March 21, 2022 11:46
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -1075,6 +1075,13 @@ func restorePlanHook(
if err != nil {
return nil, nil, nil, false, err
}
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before the 22.1 release, I think we'll need to add a docs page that provides step by step guidance on restoring backups with the new restore syntax that were originally created with the old backup syntax. That page should be linked to this warning.

Copy link
Contributor Author

@adityamaru adityamaru Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of a section about this, but I think it can either be inline where this link points to today as a notice/warning, or be linked out from there. cc: @kathancox

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, It seems like inline would be a good idea. But, I also think expanding the deprecation notice and recording this in the docs — especially if workarounds are needed if a backup was taken with BACKUP TO, but would need to be restored with the new RESTORE syntax is important. When the docs issue comes through for this with the release notes, I'll prioritize into 22.1 work.

Copy link
Member

@dt dt Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we need workarounds: recall RESTORE only supports restoring backups from the previous major version or newer, so if 22.1 deprecates backup to (but can still restore backups made with it, including by 21.2), then 22.2 can just drop support and we don't need to supply workarounds, since any 22.1-made backups, the oldest it should need to restore, should be in collections anyway.

Copy link
Collaborator

@msbutler msbutler Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adityamaru do you know if there's a clean migration from old backups that use INCREMENTAL FROM to the new incremental_location parameter? And how that interacts with locality aware backups? Aside from this, I think the user migration is pretty straightforward. Perhaps a data driven test in this PR could validate the different migration stories.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps then we should make the BACKUP TO warning even scarrier: "your backup will not be restorable in the next major release"

Copy link
Contributor Author

@adityamaru adityamaru Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is restorable right?

BACKUP TABLE foo TO 'nodelocal://1/bar' can be restored using RESTORE FROM 'bar' IN 'nodelocal://1/';? The x IN y just appends the path to y/x and looks for the manifest to restore.

I agree that we should have some documentation helping customers in 22.2 restoring backups written in 22.1 using deprecated syntax, but thats docs issue that can be addressed once this is merged?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that happy path is restorable, but there may be other user backup file configurations that may not be (e.g. ones that use INCREMENTAL FROM or locality aware backups). But i'm not sure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is restorable right?

technically yes, but I'd just as soon sidestep this whole mixing old and new and just say it isn't.

Copy link
Contributor Author

@adityamaru adityamaru Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a slightly sterner warning to the backup code, let me know what yall think.

@adityamaru adityamaru force-pushed the deprecate-old-backup branch 2 times, most recently from 24dd610 to df1a34a Compare March 22, 2022 08:49
Informs: cockroachdb#78153

Release note (sql change): The `BACKUP TO` syntax
to take backups is deprecated, and will be removed in a future
release. Users are recommended to create a backup collection
using the `BACKUP INTO` syntax in our docs.
Informs: cockroachdb#78153

Release note (sql change): The `RESTORE FROM` syntax without an
explicit subdirectory pointing to a backup in a collection is deprecated,
and will be removed in a future release.
Users are recommended to use `RESTORE FROM <backup> IN <collection>` to
restore a particular backup in a collection.
@adityamaru adityamaru force-pushed the deprecate-old-backup branch from df1a34a to 548c5e4 Compare March 22, 2022 08:57
@adityamaru
Copy link
Contributor Author

Thanks for the review!

bors r=msbutler

@craig
Copy link
Contributor

craig bot commented Mar 22, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants